# coding=utf-8
"""
Author: Mr.夏末
@Function: 字典的遍历

"""
dict001 = {'a': 8985998, 'b': 'ge', 'c': 'yuyuyug', 'd': '老Roy', 'e': 'kaka', 'f': 'youmi'}
# 获取键的列表
print(dict001.keys())
print(list(dict001.keys()))

# 基于键的遍历
for key in dict001:
    print(key,"=",dict001.get(key))
    dict001[key] = str(dict001[key]) + '1'
print(dict001)

# 基于值的遍历
for value in dict001.values():
    print(value)

# 基于键值对的遍历
for key,value in dict001.items():
    print(key,"=",value)

# 基于键值对的遍历:得到键值对的元组
for item in dict001.items():
    print(item)
